public class CalculatorFunction {

	public int calculation() {
		CalculationVO CVO = CalculationVO.getinstance();

		int checkMark = 1;
		int markPrevData = Integer.valueOf(CVO.getData()[checkMark - 1]);
		CVO.setTotal(markPrevData);

		for (int repeatNum = 1; repeatNum < CVO.getData().length; repeatNum++) {
			if (CVO.getData()[repeatNum].equals("+")) {
				checkMark = repeatNum;
				CVO.setTotal(CVO.getTotal() + Integer.valueOf(CVO.getData()[repeatNum + 1]));
			} else if (CVO.getData()[repeatNum].equals("-")) {
				checkMark = repeatNum;
				CVO.setTotal(CVO.getTotal() - Integer.valueOf(CVO.getData()[repeatNum + 1]));
			} else if (CVO.getData()[repeatNum].equals("*")) {
				checkMark = repeatNum;
				CVO.setTotal(CVO.getTotal() * Integer.valueOf(CVO.getData()[repeatNum + 1]));
			} else if (CVO.getData()[repeatNum].equals("/")) {
				checkMark = repeatNum;
				CVO.setTotal(CVO.getTotal() / Integer.valueOf(CVO.getData()[repeatNum + 1]));
			}

		}
		return CVO.getTotal();

	}
}
